﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace W8
{
    abstract class Robot {
        private string name;
        public string Name { get { return this.name; } set { this.name = value; } }
        public Robot() { }
        public Robot(string name) { this.name = name; }
        public abstract void wooking ();
    }
    class CookRobot : Robot
    {
        enum Menu
        {
            川菜,
            湘菜
        }
        public override void wooking()
        {
            Console.WriteLine("我是炒菜机器人，我们的菜品有：{0}，{1}",Menu.川菜,Menu.湘菜);
        }
    }
    class DeliveryRobot : Robot
    {
        public int hours;
        public DeliveryRobot() { }
        public DeliveryRobot(int hours) { this.hours = hours; }

        public override void wooking()
        {
            Console.WriteLine("我是传菜机器人，我已经工作{0}小时了",this.hours);
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            DeliveryRobot deliveryRobot = new DeliveryRobot();
           
            Console.WriteLine("请输入你需要执行的功能:炒菜，传菜");
            string str = Console.ReadLine();
            switch (str)
            {
                case "炒菜":
                    Robot("炒菜");
                    break;
                case "传菜":
                    Robot("传菜");
                    break;
                default:
                    break;
            }

        }
        public static void Robot(string function) {
            switch (function)
            {
                case "炒菜":
                    CookRobot cookRobot = new CookRobot();
                    cookRobot.wooking();
                    break;
                case "传菜":
                    DeliveryRobot deliveryRobot = new DeliveryRobot();
                    deliveryRobot.hours = 2;
                    deliveryRobot.wooking();
                    break;
                default:
                    break;
            }

        } 
    }
}
